{% extends '_otp.html' %}

{% block title %}
    绑定成功
{% endblock %}


{% block body_title %}
    绑定成功
{% endblock %}

{% block body_content %}
    <div class="cls-content-sm" style="width: 215px; min-width: 215px">
        <div class="text text-success mar-btm" id="messages">
            {{ messages|safe }}
        </div>
        <div class="text-center">
            <a href="{{ redirect_url }}" class="btn btn-sm btn-primary" style="width: 82px">返回</a>
        </div>
    </div>
{% endblock %}

{% block buttom_js %}
<script>
    var time = {{ interval }};
    if (!time){
        time = 5;
    } else {
        time = parseInt(time);
    }
    function redirect_page() {
        if (time >= 0) {
            var messages = '{{ messages|safe }} <b>' + time +'</b>';
            $('#messages').html(messages);
            time--;
            setTimeout(redirect_page, 1000);
        }
        else {
            window.location.href = "{{ redirect_url }}";
        }
    }
    window.onload = redirect_page;
</script>

{% endblock %}